subroutine  grides
use var
implicit none

    integer j,i
    real(8) pi
    
    select case(c_init_case) 
    case(1)
        t_end=0.5
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(2)
        t_end=0.23d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(3)
        t_end=1.8d0
        
        upx=5.d0
        downx=-5.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(4)
        t_end=0.14
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(5)
        t_end=1.3d0
        
        upx=5.d0
        downx=-5.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(6)
        t_end=0.038d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(7)
        t_end=0.23d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    endselect


end subroutine